package cn.gson.fengboot.model.pojos;

import javax.persistence.*;
import java.util.Objects;

@Entity
public class Qmodeldetails {
    private int modetId;
    private Qmodel modelId;
    private String modetContent;
    private  Qproductdetail prodetailId;


    @ManyToOne
    @JoinColumn(name = "prodetail_id")
    public Qproductdetail getProdetailId() {
        return prodetailId;
    }

    public void setProdetailId(Qproductdetail prodetailId) {
        this.prodetailId = prodetailId;
    }


    @Id
    @Column(name = "modet_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY,generator = "seq")
    public int getModetId() {
        return modetId;
    }
    public void setModetId(int modetId) {
        this.modetId = modetId;
    }

    @ManyToOne
    @JoinColumn(name = "model_id", referencedColumnName = "model_id")
    public Qmodel getModelId() {
        return modelId;
    }
    public void setModelId(Qmodel modelId) {
        this.modelId = modelId;
    }

    @Basic
    @Column(name = "modet_content")
    public String getModetContent() {
        return modetContent;
    }

    public void setModetContent(String modetContent) {
        this.modetContent = modetContent;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Qmodeldetails that = (Qmodeldetails) o;
        return modetId == that.modetId &&
                Objects.equals(modelId, that.modelId) &&
                Objects.equals(modetContent, that.modetContent);
    }

    @Override
    public int hashCode() {
        return Objects.hash(modetId, modelId, modetContent);
    }
}
